<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<title>Title</title>

<style>
#note {
	position: relative;
	width: 600px;
	height: 200px;
}

div {
	font-size: 14px;
	color: #555;
}
</style>

<script src="http://libs.baidu.com/jquery/2.0.0/jquery.min.js"></script>

</head>
<body>
	<div>
		<div>
			<tr>
				<td>标题</td>
				<td><input id="title" type="text"></td>
			</tr>
		</div>
		<br> <br> <br> <br>
		<div>
			<tr>
				<td>内容</td>
				<textarea id="note"></textarea>
			</tr>
		</div>

		<button id="save">保存</button>
	</div>
</body>

<script>
	//    $().ready(function(){
	//        alert("success");
	//    })

	$("#save").click(function() {
		var title = $("#title").val();
		var note = $("#note").val();
		var obj = new Object();
		obj.title = title;
		obj.note = note;
		$.ajax({
			url : "./save",
			datatype : "JSON",
			//contentType: 'application/json;charset=utf-8',
			data : {
				note : JSON.stringify(obj)
			},
			success : function(data) {
				alert("保存成功!");
			},
			error : function(data) {
				alert("保存失败!");
			}
		})
	})
</script>
</html>